<?php
/* [$WindsForce] (C)Hunzhiwange.COM Since 2014.07.23.
   家居公司预约看房订单模型($$)*/

!defined('Q_PATH') && exit;

class JiajubuildorderModel extends CommonModel{

	static public function init__(){
		return array(
			'table_name'=>'jiajubuildorder',
			'check'=>array(
				'jiajubuildorder_realname'=>array(
					array('require',Q::L('参观预约人姓名不能为空','__APPJIAJU_COMMON_LANG__@Model')),
					array('max_length',20,Q::L('参观预约人姓名不能超过20个字符','__APPJIAJU_COMMON_LANG__@Model')),
				),
				'jiajubuildorder_mobile'=>array(
					array('require',Q::L('参观预约人手机号码不能为空','__APPJIAJU_COMMON_LANG__@Model')),
					array('mobile',Q::L('参观预约人手机号码格式错误','__APPJIAJU_COMMON_LANG__@Model')),
				),
				'jiajubuildorder_qq'=>array(
					array('require',Q::L('参观预约人QQ不能为空','__APPJIAJU_COMMON_LANG__@Model')),
					array('max_length',20,Q::L('参观预约人QQ不能超过20个字符','__APPJIAJU_COMMON_LANG__@Model')),
				),
				'jiajubuildorder_address'=>array(
					array('max_length',150,Q::L('参观预约人住址不能超过150个字符','__APPJIAJU_COMMON_LANG__@Model')),
				),
				'jiajubuildorder_remark'=>array(
					array('max_length',250,Q::L('参观预约人其他要求不能超过250个字符','__APPJIAJU_COMMON_LANG__@Model')),
				),
			),
		);
	}

	static function F(){
		$arrArgs=func_get_args();
		return ModelMeta::instance(__CLASS__)->findByArgs($arrArgs);
	}

	static function M(){
		return ModelMeta::instance(__CLASS__);
	}

	protected function beforeSave_(){
		$this->jiajubuildorder_mobile=C::text($this->jiajubuildorder_mobile);
		$this->jiajubuildorder_qq=C::text($this->jiajubuildorder_qq);
		$this->jiajubuildorder_address=C::text($this->jiajubuildorder_address);
		$this->jiajubuildorder_remark=C::text($this->jiajubuildorder_remark);
		$this->jiajubuildorder_username=C::text($this->jiajubuildorder_username);
		$this->jiajubuildorder_editusername=C::text($this->jiajubuildorder_editusername);
	}

}
